home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6741 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.8 KB  |  50 lines

  1. Newsgroups: comp.lang.c++
  2. Path: natlab.research.philips.com!ijntema
  3. From: ijntema@natlab.research.philips.com (Hans IJntema)
  4. Subject: Re: Borland C++ 4.5 FLoating point error?
  5. Sender: news@natlab.research.philips.com (USENET News System)
  6. Message-ID: <ijntema.233.002A1385@natlab.research.philips.com>
  7. Date: Mon, 12 Feb 1996 08:09:08 GMT
  8. References:  <4fj728$187a@news.doit.wisc.edu>
  9. Organization: Philips Research
  10. X-Newsreader: Trumpet for Windows [Version 1.0 Rev B]
  11.  
  12. In article <4fj728$187a@news.doit.wisc.edu> cstelzer@students.wisc.edu (Christopher Stelzer) writes:
  13. >From: cstelzer@students.wisc.edu (Christopher Stelzer)
  14. >Subject: Borland C++ 4.5 FLoating point error?
  15. >Date: 10 Feb 1996 22:43:20 GMT
  16.  
  17. >I have been having a problem inputing any number with decimals.  I have been 
  18. >using the "cin >>" command and have tried using "scanf".  When I declare the 
  19. >variable to be inputted as float, double or long I get a floating point 
  20. >overflow error. Running turbo debugger over it, I find out it seems to be a 
  21. >problem with my processor (100mhz pentium).  Is the problem my processor?  Is 
  22. >there a programming fix?  Has anyone else had this problem before?  
  23. >Please reply directly to cstelzer@students.wisc.edu
  24.  
  25. >thanx
  26. >chris stelzer
  27. >madison, wi
  28.  
  29. This is documented in a FAQ, don't know which one...
  30.  
  31. If you use floating points in scanf etc, (%f) and no floating points ops in 
  32. the rest of the program, the linker does not link the floating point lib. Put 
  33. somewhere in your program something like    float a = 1.0/2.0;
  34.  
  35.  
  36.  
  37.  
  38. ___________________________________________________________________________
  39. Hans IJntema
  40. Philips Research
  41. Building WO-02
  42. Prof. Holstlaan 4
  43. 5656 AA Eindhoven
  44. The Netherlands
  45.  
  46. e-mail: ijntema@natlab.research.philips.com
  47. Phone:  +31 40 2743325 or 2742877 
  48. Fax:    +31 40 2742630
  49. ___________________________________________________________________________
  50.